# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexTableSpec do
  @moduledoc """
  Entry specification for a Dataplex table.

  ## Attributes

  *   `dataplexSpec` (*type:* `GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexSpec.t`, *default:* `nil`) - Common Dataplex fields.
  *   `externalTables` (*type:* `list(GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexExternalTable.t)`, *default:* `nil`) - List of external tables registered by Dataplex in other systems based on the same underlying data. External tables allow to query this data in those systems.
  *   `userManaged` (*type:* `boolean()`, *default:* `nil`) - Indicates if the table schema is managed by the user or not.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataplexSpec =>
            GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexSpec.t() | nil,
          :externalTables =>
            list(GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexExternalTable.t())
            | nil,
          :userManaged => boolean() | nil
        }

  field(:dataplexSpec, as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexSpec)

  field(:externalTables,
    as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexExternalTable,
    type: :list
  )

  field(:userManaged)
end

defimpl Poison.Decoder,
  for: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexTableSpec do
  def decode(value, options) do
    GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexTableSpec.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1DataplexTableSpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
